*** Settings ***
Resource   ../Common_Head.robot

*** Variables ***


*** Keywords ***
Select Column for AIR Template
    Wait Until Search Finished
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${CD_Origin_Checks}    contains    visible
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${CD_Remarks}    contains    visible
    Click    ${CD_Remarks}
    Click    ${CD_Remarks}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${CD_TBN}    contains    visible
    Click    ${CD_TBN}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${CD_LaneNumber}    contains    visible
    Click    ${CD_LaneNumber}
    Click    ${CD_LaneNumber}
    Click    ${CD_PostalCode}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${CD_DRG}    contains    visible
    Click    ${CD_DRG}
    Click    ${CD_DRG}
    Click    ${CD_TemperatureControlled}
    Click    ${CD_TemperatureControlled}
    Click    ${CD_ForPricingLeadOnly}
    Click    ${CD_CustomerTargetInformation}
    Click    ${CD_ServiceLevelCustomer}
    Click    ${Template_OriginChargesTab}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${OC_Currency}    contains    visible
    Click    ${OC_-100kg}
    Click    ${OC_+100kg}
    Click    ${OC_+250kg}
    Click    ${OC_+500kg}
    Click    ${OC_+1000kg}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${OC_SpecialExportHandling}    not contains    disabled
    Click    ${OC_SpecialExportHandling}
    Click    ${OC_FTL}
    Click    ${OC_TBN}
    Click    ${Template_AirfreightandChargesTab}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${AC_Currency}    contains    visible
    Click    ${AC_AirfreightRate}
    Click    ${AC_AirfreightRate}
    # Click    ${AC_Envirotainer}
    Click   ${AC_TBN}
    Click    ${AC_CustomerSurcharges}
    # Click    ${AC_DBSchenkerFSCBuffer}
    # Click    ${AC_DBSchenkerSSCBuffer}
    Click    ${AC_AMS}
    Click    ${AC_DGRAdd-OnCharges}
    Click    ${AC_DGRAirlineCheckFee}
    Click    ${AC_DGRSchenkerCheckFee}
    Click    ${AC_AircraftServiceType}
    Click    ${AC_Frequency}
    Click    ${AC_AvailableCapacity}
    Click    ${AC_MaxShipmentSize}
    Click    ${AC_AvailableCapacitydims}
    Click    ${Template_DestinationLinehaulTab}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${DL_Currency}    contains    visible
    Click    ${DL_In-TransitHandling}
    Click    ${Template_CustomerDataTab}
    Click    ${Template_DestinationChargesTab}
    Wait Until Keyword Succeeds   20x    500ms    Get Element States    ${DC_Currency}    contains    visible
    Click    ${DC_SpecialImportHandling}
    Click    ${DC_DeliveryCharges}
    Click    ${DC_DeliveryCharges}
    Click    ${DC_FTL}
    Click   ${DC_TBN}

Push Skip and check for AIR Template
    Wait Until Keyword Succeeds   20x    500ms    Get Element States   ${Template_SkipSendToGPDButton}    not contains    disabled
    Click    ${Template_SkipSendToGPDButton}
    Check Text Value    ${SkipSendToGPDMessage}    Are you sure to skip push pricing?
    Click    ${SkipSendToGPD_Yes}